home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / tpwprog5.arj / MENU.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-07-02  |  1.1 KB  |  57 lines

  1. { menu.pas -- Demonstrate pulldown menus }
  2.  
  3. program Menu;
  4.  
  5. {$R menu.res}
  6.  
  7. uses WinTypes, WinProcs, WObjects;
  8.  
  9. const
  10.  
  11.   id_Menu = 100;
  12.  
  13. type
  14.  
  15.   MenuApplication = object(TApplication)
  16.     procedure InitMainWindow; virtual;
  17.   end;
  18.  
  19.   PMenuWindow = ^MenuWindow;
  20.   MenuWindow = object(TWindow)
  21.     constructor Init(AParent: PWindowsObject; ATitle: PChar);
  22.   end;
  23.  
  24. { MenuApplication }
  25.  
  26. {- Initialize the application's window }
  27. procedure MenuApplication.InitMainWindow;
  28. begin
  29.   MainWindow := New(PMenuWindow, Init(nil, 'Menu Demonstration'))
  30. end;
  31.  
  32. { MenuWindow }
  33.  
  34. {- Initialize the application's window object }
  35. constructor MenuWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  36. begin
  37.   TWindow.Init(AParent, ATitle);
  38.   Attr.Menu := LoadMenu(HInstance, PChar(id_Menu))
  39. end;
  40.  
  41. var
  42.  
  43.   MenuApp: MenuApplication;
  44.  
  45. begin
  46.   MenuApp.Init('Menu');
  47.   MenuApp.Run;
  48.   MenuApp.Done
  49. end.
  50.  
  51.  
  52. { --------------------------------------------------------------
  53.   Copyright (c) 1991 by Tom Swan. All rights reserved.
  54.   Revision 1.00    Date: 1/11/91
  55.   ------------------------------------------------------------- }
  56.  
  57.